package com.erp.erp_servers.Purchase;

import com.erp.erp_entitys.Customer2.Customer2Entity;
import com.erp.erp_entitys.Inquiry.InquiryVo;
import com.erp.erp_entitys.Purchase.*;
import com.erp.erp_entitys.Purchase.req.PurchaseOrderRestockReq;
import com.erp.erp_entitys.Purchase.req.PurchaseProductIntegrationReq;
import com.erp.erp_entitys.Purchase.req.purchaseSampleStatisticsReq;
import com.erp.erp_entitys.Purchase.res.PurchaseDataVo;
import com.erp.erp_entitys.Purchase.res.PurchaseOrderRestockRes;
import com.erp.erp_entitys.Purchase.res.PurchaseProductIntegrationRes;
import com.erp.erp_entitys.Purchase.res.purchaseSampleStatisticsRes;
import com.github.pagehelper.PageInfo;

import java.util.List;
import java.util.Map;

public interface IPurchaseService {

    /**
     * 通过实体作为筛选条件查询
     * @param req 实例对象
     * @return 对象列表
     */
    List<Purchase> queryAll(Purchase req);

    int deleteByPrimaryKey(Integer id, Integer upType, String upUser);

    int insert(Purchase record);

    int insertSelective(Purchase record);

    Purchase selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Purchase record);

    int updateByPrimaryKey(Purchase record);

    PageInfo<PurchaseDataVo> selectPurchaseList(PurchaseVo vo);

    List<Purchase> selectByIdList(List<Integer> list);

    int updateBoxStatusByKey(PurchaseVo vo);

    int updateValid(Integer id, Integer valid, Integer upType, String upUser);

    /**
     * 按主键查询采购及关联数据
     * @param id
     * @return
     */
    Purchase selectInfoById(Integer id);

    boolean isExist(String oddNumber);

    Customer2Entity selectCustomer2ByCode(String code);

    /**
     * 更新流程状态
     * @param bid 采购主键
     * @param spStatus 流程状态
     * @return
     */
    boolean updateStatus(String bid, String spStatus);

    /**
     * 按采购单号查询采购全部信息
     * @param purchaseOrderNo 采购单号
     * @return
     */
    Purchase selectByNo(String purchaseOrderNo);

    /**
     * 按id查询图片路径
     * @param id
     * @return
     */
    ImgUrl selectImgUrlById(Integer id);

    List<PurchaseProduct> selectPurchaseProductByCode(String productNo, String specNo);

    /**
     * 修改附件
     * @param id 采购id
     * @param executorCode 操作员编码
     * @param fileList 附件
     * @return
     */
    int updatePurchaseFile(Integer id, String executorCode, List<PurchaseFile> fileList);

    /**
     * 根据采购单号获取名称中包含fileName的信息的附件
     * @param purchaseOrderNo
     * @param fileName
     * @return
     */
    List<PurchaseFile>    getFileByPurchaseOrderNo(String purchaseOrderNo,String fileName);

    /**
     * 保存采购审批信息
     * @return
     */
    int insertProcess(PurchaseProcessEntity purchaseProcessEntity);

    /**
     * 根据采购订单号查询审批信息
     * @param purchaseidList
     * @return
     */
    List<PurchaseProcessEntity> getProcessList(List purchaseidList);
    /**
     * 查询审批人的审批信息
     * @param spr
     * @return
     */
    List<PurchaseProcessEntity> getProcessBySPR(String spr);


    /**
     * 补货采购订单
     * @return
     */
    List<PurchaseOrderRestockRes> purchaseOrderRestockList(PurchaseOrderRestockReq req);
    /**
     * 采购产品整合
     * @return
     */
    List<PurchaseProductIntegrationRes> purchaseProductIntegrationList(PurchaseProductIntegrationReq req);

    /**
     * 获取采购信息
     * @param purchase 采购实体
     * @return 采购信息
     */
    Purchase getPurchaseInfo(Purchase purchase);

    /**
     * 样品采购付款详情
     * @return
     */
    List<purchaseSampleStatisticsRes> purchaseSampleStatisticsList(purchaseSampleStatisticsReq req);
}